<script setup lang="ts">
// import { reqLogin } from '@/api/user/index';
// import type { loginForm, loginRespData } from '@/api/user/type';
import { useMain } from '@/store/modules/user'; // 引入store
const useStoreMain = useMain();
const route = useRouter();

onMounted(async () => {
  console.log('🚀 ~ file: App.vue:7 ~ route:', route.options);
});

const clickBtn = () => {
  useStoreMain.userInfo();
};

// console.log('🚀 ~ file: App.vue:12 ~ router:', route.options);
// 获取全部路由

// let lofinFrom: loginForm = reactive({
//   username: 'admin',
//   password: '123456',
// });

// onMounted(async () => {
//   let res: loginRespData = await reqLogin(lofinFrom);
//   console.log('🚀 ~ file: App.vue:6 ~ mounted ~ res:', res);
// });

// const msg = ref('hello nihao');

// const click = () => {
//   ElMessage.success('houdunren.com');
// };
</script>

<template>
  <div style="display: flex; flex-direction: column">
    <router-link to="/login">login</router-link>
    <router-link to="/">layout</router-link>
    <router-link to="/acl/user">user</router-link>
    <router-link to="/product">product</router-link>
  </div>
  <button @click="clickBtn">点击</button>
  <!-- <el-row class="mb-4">
    <el-button>Default</el-button>
    <el-button type="primary" @click="click">Primary</el-button>
    <el-button type="success">Success</el-button>
    <el-button type="info">Info</el-button>
    <el-button type="warning">Warning</el-button>
    <el-button type="danger">Danger</el-button>
  </el-row>
  <el-icon>
    <Edit />
  </el-icon>
  <div class="test">
    <p>{{ msg }}</p>
  </div>
  <SvgIcon name="vue" color="red" width="50px" height="50px"></SvgIcon>
  <hr />

  <hr /> -->
  <router-view></router-view>
  <!-- <router-link to="/home"></router-link> -->
</template>

<style scoped lang="scss">
::v-deep(a) {
  height: 50px;
}
.test {
  p {
    color: $color;
  }
}
</style>
